package java8Test.function.lambda.part2;

/**
 * @author : yang.xp
 * @date : 2022/9/22 16:03
 * @description : 匿名内部类的lambda
 */
public class Example1 {

    public static void main(String[] args) {
        Example1 example1 = new Example1();
        example1.test(new ApplicationExp1() {
            @Override
            public void apply() {
                System.out.println("fffuuu");
            }
        });
        example1.test(() -> System.out.println("fffsss"));

    }

    public void test(ApplicationExp1 applicationExp1) {
        applicationExp1.apply();
    }
}

// 接口中只能有一个方法
interface ApplicationExp1 {

    void apply();

//    void apply(int t);
}
